﻿{extend name="common/base"}
{block name="title"}结账页{/block}

<body>

{block name="content"}
	<!-- checkout -->
	<div class="segments-page">
		<div class="container">
			<form action="{:url('index/Paycar/paycar')}{if condition="isset($coupon_list)"}?coupon_id={$coupon_list.id}{/if}" method="POST" id="subform">
				<div class="pages-title">
					<h3>确认订单</h3>
				</div>
				<a href="{:url('index/cart/myAddress')}">
					<div class="product-choosed">
						<div class="row">
							<div class="col s12">
								<p style="font-size:16px;">收货人姓名 : <span id="shouhuo_name">{$address_list.shouhuo_name}</span></p>
								<p style="font-size:16px;">收货人电话 : <span id="shouhuo_tell">{$address_list.shouhuo_tell}</span></p>
								<p>收货地址 : <span id="shouhuo_address">{$address_list.shouhuo_address}</span><i class="fa fa-angle-right" style="float:right;padding-top:5px;"></i></p>
								<input type="hidden" value="{$address_list.id}" name="address_id" id="address_id">
							</div>
						</div>
					</div>
				</a>
				<div class="product-choosed">
					{volist name="list" id="val"}
					<div class="row" id="pay-list">
						<div class="col s4">
							<div class="contents">
								<img src="{$val.src[0]}" alt="">
							</div>
						</div>
						<div class="col s6">
							<div class="contents" style="color:black;">
								{$val.name}
								<input type="hidden" value="{$val.id}" name="goods_id[]">
								<input type="hidden" value="{$val.attributes_id}" name="attributes_id[]">
							</div>
							{if condition="$val['first_guige_name']!=NULL"}
							<div class="contents">
								{$val.first_guige_name}+{$val.guigeName}
							</div>
							{else /}
							<div class="contents">
								{$val.guigeName}
							</div>
							{/if}
						</div>
						<div class="col s4">
							<div class="contents">
								<p>价格</p>
							</div>
						</div>
						<div class="col s8">
							<div class="contents">
								<p class="price">¥{$val.price}</p>
							</div>
						</div>
						<div class="col s4">
							<div class="contents">
								<p>数量</p>
							</div>
						</div>
						<div class="col s8">
							<div class="contents">
								<p class="price">x{$val.num}</p>
								<input type="hidden" value="{$val.num}" name="goods_num[]">
							</div>
						</div>
					</div>
					{/volist}
					<div class="row">
						<div class="col s4">
							<div class="contents">
								<p>店铺优惠</p>
							</div>
						</div>
						<div class="col s8">
							<div class="contents">
								<p>
									<a href="{:url('index/product/coupon')}">使用优惠券<i class="fa fa-angle-right"></i></a>
									{if condition="isset($coupon_list)"}<span style="margin-left:10px;color:#e82954;">{$coupon_list.coupon_name}</span><input type="hidden" value="{$coupon_list.coupon_money}" id="coupon-money">{/if}
								</p>
							</div>
						</div>
						<div class="col s4">
							<div class="contents">
								<p>积分结算</p>
							</div>
						</div>
						<div class="col s6">
							<div class="contents">
								<p><input type="checkbox" name="check" value="1" style="width:20px;height:20px;margin-top:-10px;"></p>
							</div>
						</div>
					</div>
				</div>
				<div class="total-pay">
					<div class="row">
						{volist name="list" id="val"}
							<div class="col s8">
								<div class="contents">
									<p>{$val.name}</p>
								</div>
							</div>
							<div class="col s4">
								<div class="contents right">
									<p>¥{$val.xiaoji}</p>
								</div>
							</div>
						{/volist}
						<div class="col s8">
							<div class="contents">
								<h5>总计</h5>
							</div>
						</div>
						<div class="col s4">
							<div class="contents right">
								<h5 id="totalPrice" style="color: #e82954;">¥{$zongji}</h5>
								<input type="hidden" value="{$zongji}" id="totalPriceBox" name="totalPrice">
							</div>
						</div>
					</div>
				</div>
				<button class="button checkout-button" type="button" onclick="showModal2();"><i class="fa fa-send"></i>结账</button>
			</form>
		</div>
	</div>
	<!-- end checkout -->
	<!-- BEGIN 支付窗口 --> 
	<div id="screen-box-div">
		<div class="screen-box-item">
			<div class="screen-box-item-title" style="text-align: left;padding-left: 20px;">支付方式
				<a onclick="hideModal2();" style="text-align:center;cursor:pointer;">X</a>
			</div>
			<div style="height: auto;padding: 10px 30px;">
				<div style="float: left;width:100%">
					<img src="__STATIC__/index/default/yue.jpeg" style="width:30px;height:30px;float: left;margin-top:-7px;">
					<a href=""><span style="float: left;"> 零钱(剩余¥<span id="money">1999.00</span> )</span></a>
				</div></br>
				<div style="float: left;margin-top:15px;width:100%">
					<img src="__STATIC__/index/default/zhifubao.jpeg" style="width:30px;height:30px;float: left;margin-top:-7px;">
					<a href="" onclick="document.getElementById('subform').submit();return false"><span style="float: left;"> 支付宝支付</span></a>
				</div>
			</div>
		</div>
	</div>
	<!-- END 支付窗口 -->
{/block}

</body>
{block name="footjs"}
<script type="text/javascript">
	//隐藏评论窗口,方式淡出
	function hideModal2()
	{
		$('#screen-box-div').fadeOut();
	}
	function showModal2()
	{
		$('#screen-box-div').fadeIn();
	}
</script>
<script>
$(function(){
	if($("#coupon-money").val()!=undefined){
		$("#totalPrice").html('¥'+($("#totalPriceBox").val()-$("#coupon-money").val()));
		var str = $("#totalPrice").html();
		var num = str.substring(1);
		$("#totalPriceBox").val(num);
	}
})
</script>
{/block}
</html>
